<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript内置对象</title>
</head>
<body>
    <h1>JavaScript内置对象</h1>
    <p>函数对象、基础类型的包装器对象、数学(Math)对象、日期(Date)对象</p>
    <script>
        //1. 函数对象
        document.write(eval(2+3));  //危险的函数
        document.write(`<br>`);
        document.write(parseFloat("     3.14a"));
        document.write(`<br>`);
        document.writeln(parseInt("15.4a"));
        document.writeln(parseInt("0xF",16));
        document.writeln(parseInt("1111",2));
        document.writeln(parseInt("F",16));
        document.writeln(parseInt("17",8));
        document.writeln(parseInt(021,8));
        document.writeln(parseInt("015",10));
        document.writeln(parseInt("15.99",10));
        document.write(`<br>`);
        document.writeln(encodeURI("张三"));
        document.writeln(decodeURI("%E5%BC%A0%E4%B8%89"));
        document.write(`<br>`);

        //2. 包装器对象  Boolean  Number String
        let str=new String("a");
        str =str.concat("b");
        document.writeln(`${str}`);
        let i=new Number(1);
        document.writeln(`${i}`)
        document.write(`<br>`);

        //3. Math
        document.writeln(Math.floor(Math.random()*10)+1);
        document.write(`<br>`);

        //4. Date
        document.writeln(Date.now());
        let d=new Date();
        document.writeln(d.toLocaleString());
    </script>
</body>
</html>